<%--
  Created by IntelliJ IDEA.
  User: HKemmm
  Date: 2022/3/10
  Time: 17:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head lang="en">
    <meta charset="utf-8"/>
    <title>鲜花时光</title>
    <link rel="stylesheet" type="text/css" href="/static/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/myorder.css"/>


    <style>
        .sx img {
            width: 162px;
            height: 162px;
        }
    </style>
</head>
<body>
<!------------------------------head------------------------------>
<div class="head ding">
    <div class="wrapper clearfix">
        <div class="clearfix" id="top">
            <h1 class="fl"><a href="/page/index.jsp"><img src="/static/moban/img/logo/logo.png"/></a></h1>
            <div class="fr clearfix" id="top1">
                <p class="fl">
                    <a href="#" id="login">登录</a>
                    <a href="#" id="reg">注册</a>
                </p>
                <form action="#" method="get" class="fl">
                    <input type="text" placeholder="搜索"/>
                    <input type="button"/>
                </form>
                <div class="btn fl clearfix">
                    <a href="mygxin.html"><img src="/static/img/grzx.png"/></a>
                    <a href="#" class="er1"><img src="/static/img/ewm.png"/></a>
                    <a href="cart.html"><img src="/static/img/gwc.png"/></a>
                    <p><a href="#"><img src="/static/img/smewm.png"/></a></p>
                </div>
            </div>
        </div>
        <ul class="clearfix" id="bott">
            <li><a href="index.html">首页</a></li>
            <li>
                <a href="#">所有商品</a>
                <div class="sList">
                    <div class="wrapper  clearfix">
                        <a href="paint.html">
                            <dl>
                                <dt><img src="/static/img/nav1.jpg"/></dt>
                                <dd>浓情欧式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="/static/img/nav2.jpg"/></dt>
                                <dd>浪漫美式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="/static/img/nav3.jpg"/></dt>
                                <dd>雅致中式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="/static/img/nav6.jpg"/></dt>
                                <dd>简约现代</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="/static/img/nav7.jpg"/></dt>
                                <dd>创意装饰</dd>
                            </dl>
                        </a>
                    </div>
                </div>
            </li>
            <li>
                <a href="flowerDer.html">装饰摆件</a>
                <div class="sList2">
                    <div class="clearfix">
                        <a href="proList.html">干花花艺</a>
                        <a href="vase_proList.html">花瓶花器</a>
                    </div>
                </div>
            </li>
            <li>
                <a href="decoration.html">布艺软饰</a>
                <div class="sList2">
                    <div class="clearfix">
                        <a href="zbproList.html">桌布罩件</a>
                        <a href="bzproList.html">抱枕靠垫</a>
                    </div>
                </div>
            </li>
            <li><a href="paint.html">墙式壁挂</a></li>
            <li><a href="perfume.html">蜡艺香薰</a></li>
            <li><a href="idea.html">创意家居</a></li>
        </ul>
    </div>
</div>
<!------------------------------idea------------------------------>
<div class="address mt">
    <div class="wrapper clearfix">
        <a href="index.html" class="fl">首页</a>
        <span>/</span>
        <a href="mygxin.html" class="on">个人中心</a>
        <span>/</span>
        <a href="myprod.html" class="on">待评价商品</a>
    </div>
</div>


<!------------------------------Bott------------------------------>
<div class="Bott">
    <div class="wrapper clearfix">
        <div class="zuo fl">
            <h3>
                <a><img class="zuo-img" src="/myimg/${sessionScope.User.photo}"/></a>
                <p class="clearfix"><span class="fl">[${sessionScope.User.name}]</span><span class="fr">[退出登录]</span>
                </p>
                <input type="hidden" value="${sessionScope.User.id}" id="userId">
            </h3>
            <div>
                <h4>我的交易</h4>
                <ul>
                    <li><a href="/shop/car?id=${sessionScope.User.id}">我的购物车</a></li>
                    <li><a href="/jump/mysorder">我的订单</a></li>
                    <li class="on"><a href="/jump/myprod">评价晒单</a></li>
                </ul>
                <h4>个人中心</h4>
                <ul>
                    <li><a href="/shop/centre">我的中心</a></li>
                    <li><a href="/address/addressInfo?uid=${sessionScope.User.id}">地址管理</a></li>
                </ul>
                <h4>账户管理</h4>
                <ul>
                    <li><a href="/jump/mygrxx">个人信息</a></li>
                    <li><a href="/jump/remina">修改密码</a></li>
                </ul>
            </div>
        </div>
        <div class="you fl">
            <div class="my clearfix">
                <h2 class="fl">商品评价</h2>
            </div>
            <div class="dlist">
                <ul class="clearfix" id="pro">
                    <li class="on"><a>待评价商品</a></li>
                    <li><a>已评价商品</a></li>
                    <li><a>评价失效商品</a></li>
                </ul>
            </div>
            <div class="sx clearfix">
                <div class="clearfix  comment1">

                </div>
                <div class="clearfix comment2">

                </div>
                <div class="clearfix comment3">

                </div>
            </div>
        </div>
    </div>
</div>

<!--<dl class="fl">
                    <dt><a href="#"><img src="img/nav3.jpg"/></a></dt>
                    <dd><a href="#">家用创意壁挂  釉下彩复古</a></dd>
                    <dd>¥199.00</dd>
                    <dd>16000人评价</dd>
                    <dd><a href="#">待评价</a></dd>
                </dl>
                <dl class="fl">
                    <dt><a href="#"><img src="img/nav3.jpg"/></a></dt>
                    <dd><a href="#">家用创意壁挂  釉下彩复古</a></dd>
                    <dd>¥199.00</dd>
                    <dd>16000人评价</dd>
                    <dd><a href="#">待评价</a></dd>
                </dl>-->

<!--遮罩-->
<div class="mask"></div>
<!--评价弹框-->
<div class="pj">
    <div class="clearfix"><a href="#" class="fr gb"><img src="/static/img/icon4.png"/></a></div>
    <h3>商品评价</h3>
    <form>
        <input type="hidden" id="orderDetailId" value="">
        <input type="hidden" id="goods1" value="">
        <textarea id="comment" name="" rows="" cols="" placeholder="请输入评价"></textarea>
        <div class="bc">
            <input type="button" onclick="addComment()" value="保存"/>
            <input type="button" value="取消"/>
        </div>
    </form>
</div>


<!--返回顶部-->
<div class="gotop">
    <a href="cart.html">
        <dl>
            <dt><img src="/static/img/gt1.png"/></dt>
            <dd>去购<br/>物车</dd>
        </dl>
    </a>
    <a href="#" class="dh">
        <dl>
            <dt><img src="/static/img/gt2.png"/></dt>
            <dd>联系<br/>客服</dd>
        </dl>
    </a>
    <a href="mygxin.html">
        <dl>
            <dt><img src="/static/img/gt3.png"/></dt>
            <dd>个人<br/>中心</dd>
        </dl>
    </a>
    <a href="#" class="toptop" style="display: none">
        <dl>
            <dt><img src="/static/img/gt4.png"/></dt>
            <dd>返回<br/>顶部</dd>
        </dl>
    </a>
    <p>400-800-8200</p>
</div>
<!--footer-->
<div class="footer">
    <div class="top">
        <div class="wrapper">
            <div class="clearfix">
                <a href="#2" class="fl"><img src="/static/img/foot1.png"/></a>
                <span class="fl">7天无理由退货</span>
            </div>
            <div class="clearfix">
                <a href="#2" class="fl"><img src="/static/img/foot2.png"/></a>
                <span class="fl">15天免费换货</span>
            </div>
            <div class="clearfix">
                <a href="#2" class="fl"><img src="/static/img/foot3.png"/></a>
                <span class="fl">满599包邮</span>
            </div>
            <div class="clearfix">
                <a href="#2" class="fl"><img src="/static/img/foot4.png"/></a>
                <span class="fl">手机特色服务</span>
            </div>
        </div>
    </div>
    <p class="dibu">最家家居&copy;2013-2017公司版权所有 京ICP备080100-44备0000111000号<br/>
        违法和不良信息举报电话：400-800-8200，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</p>
</div>
<script src="/static/js/jquery-1.12.4.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/public.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/user.js" type="text/javascript" charset="utf-8"></script>


<script>
    var uid = $("#userId").val();


    $(function () {
        $.ajax({
            url: "/order/getOrderComment",
            data: {
                uid: uid,
                status: "2"
            },
            success: function (data) {
                if (data == null || data == "") {
                    return false;
                }
                var content = '';


                for (var i = 0; i < data.length; i++) {
                    content += '<dl class="fl">' +
                        '<dt><a href="/Goods/product?id=' + data[i].goodsId + '"><img src="/myimg/' + data[i].goods.img + '"/></a></dt>' +
                        '<dd><a href="/Goods/product?id=' + data[i].goodsId + '">' + data[i].goods.name + '</a></dd>' +
                        '<dd>¥' + data[i].goods.price + '</dd>' +
                        '<dd>' + data[i].goods.commentNum + '条评价</dd>' +
                        '<dd><a onclick="openModel(' + data[i].goodsId + ',' + data[i].id + ')">评价</a></dd>' +
                        '</dl>';
                }

                $(".comment1").html(content);
            }
        });


        $.ajax({
            url: "/order/getOrderComment",
            data: {
                uid: uid,
                status: "3"
            },
            success: function (data) {
                if (data == null || data == "") {
                    return false;
                }
                var content = '';


                for (var i = 0; i < data.length; i++) {
                    content += '<dl class="fl">' +
                        '<dt><a href="/Goods/product?id=' + data[i].goodsId + '"><img src="/myimg/' + data[i].goods.img + '"/></a></dt>' +
                        '<dd><a href="/Goods/product?id=' + data[i].goodsId + '">' + data[i].goods.name + '</a></dd>' +
                        '<dd>¥' + data[i].goods.price + '</dd>' +
                        '<dd>' + data[i].goods.commentNum + '条评价</dd>' +
                        '<dd><a onclick="openModel(' + data[i].goodsId + ',' + data[i].id + ')">追加评价</a></dd>' +
                        '</dl>';
                }

                $(".comment2").html(content);
            }
        });

        $.ajax({
            url: "/order/getNoOrderComment",
            data: {
                uid: uid
            },
            success: function (data) {
                if (data == null || data == "") {
                    return false;
                }
                var content = '';


                for (var i = 0; i < data.length; i++) {
                    content += '<dl class="fl">' +
                        '<dt><a href="/Goods/product?id=' + data[i].goodsId + '"><img src="/myimg/' + data[i].goods.img + '"/></a></dt>' +
                        '<dd><a href="/Goods/product?id=' + data[i].goodsId + '">' + data[i].goods.name + '</a></dd>' +
                        '<dd>¥' + data[i].goods.price + '</dd>' +
                        '<dd>' + data[i].goods.commentNum + '条评价</dd>' +
                        '<dd><a>暂不能评价</a></dd>' +
                        '</dl>';
                }

                $(".comment3").html(content);

            }
        });

    });

    function openModel(gid, oid) {
        $(".mask").show();
        $(".pj").show();

        $("#orderDetailId").val(oid);
        $("#goods1").val(gid);
    }

    function addComment() {
        $.ajax({
            url: "/addComment",
            data: {
                userId: uid,
                goodsId: $("#goods1").val(),
                content: $("#comment").val(),
                id: $("#orderDetailId").val()
            },
            success: function (response) {
                if (response == "ok") {
                    alert("评价成功！");
                    location.reload();
                } else {
                    alert("评价失败！");
                    location.reload();
                }


            }
        });
    }


</script>
</body>
</html>

